package com.shopcz.lsy.manager;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.google.gson.Gson;
import com.shopcz.dao.GoodsDao;
import com.shopcz.dao.UserDao;
import com.shopcz.lsy.page.MyProductPage;
import com.shopcz.pojo.User;

public class CheckPsw {
	public String psw(HttpServletRequest request,HttpServletResponse response){
		response.setContentType("text/application;charset=utf-8");
		User user = (User)request.getSession().getAttribute("user_login");
		UserDao ud=new UserDao();
		user=ud.queryUser(user.getUserId());
        
		Gson gson=new Gson();
		String jsonString=gson.toJson(user);
		response.setContentType("text/gson;charset=utf-8");
		PrintWriter pw;
		try {
			pw = response.getWriter();
			pw.println(jsonString);
			pw.flush();
			
		} catch (IOException e) {
			e.printStackTrace();
		}
	
		
		return null;

	}
}
